<template>
<div>
    <el-container>
        <el-header>校园招聘系统后台
            <el-dropdown @command="handleCommand" class="admin-self">
                <span class="el-dropdown-link">
                    admin<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item command="退出" icon="el-icon-plus">退出</el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </el-header>
        <el-container>
            <el-aside width="201px">
                <el-menu default-active="/adminmain/graduatemanager" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" background-color="#303133" text-color="#fff" active-text-color="#ffd04b" :router="true">
                    <el-submenu index="">
                        <template slot="title">
                            <i class="el-icon-user"></i>
                            <span>用户管理</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="/adminmain/graduatemanager">
                                <i class="el-icon-user"></i>学生用户
                            </el-menu-item>
                            <el-menu-item index="/adminmain/enterprisermanager">
                                <i class="el-icon-user"></i>企业用户
                            </el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                    <el-menu-item index="/adminmain/enterprisemanager">
                        <i class="el-icon-s-home"></i>
                        <span slot="title">企业管理</span>
                    </el-menu-item>
                    <el-menu-item index="/adminmain/positionmanager">
                        <i class="el-icon-menu"></i>
                        <span slot="title">职位管理</span>
                    </el-menu-item>
                    <el-menu-item index="/adminmain/chartmanager">
                        <i class="el-icon-s-data"></i>
                        <span slot="title">图表分析</span>
                    </el-menu-item>
                </el-menu>
            </el-aside>
            <el-main>
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</div>
</template>

<script>
export default {
    name: "RecommendAdminMain",

    data() {
        return {
            isCollapse: true,
        };
    },

    mounted() {},

    methods: {
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        },
        handleCommand(command) {
            if (command === "退出") {
                window.localStorage.removeItem("token");
                this.$router.push("/login");
            }
        },
    },
};
</script>

<style scoped>
.el-header,
.el-footer {
    background-color: #333;
    color: whitesmoke;
    text-align: left;
    line-height: 60px;
}

.el-aside {
    margin-top: 5px;
    background-color: #303133;
    color: #333;
    text-align: center;
    line-height: 200px;
    height: 555px;
}

.el-main {
    margin-top: 5px;
    background-color: #e9eef3;
    color: #333;
    text-align: center;
    line-height: 100%;
    height: 555px;
    flex-grow: 1;
    margin-left: 5px;
}

body>.el-container {
    margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
    line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
    line-height: 320px;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
}

.el-dropdown-link {
    cursor: pointer;
    color: whitesmoke;
}

.el-icon-arrow-down {
    font-size: 12px;
}

.admin-self {
    float: right;
}
</style>
